home *** CD-ROM | disk | FTP | other *** search
- head 1.7;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.7
- date 89.08.15.19.55.32; author rab; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 89.04.10.16.22.28; author brent; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 89.03.23.09.08.24; author brent; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 89.02.21.10.06.07; author brent; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.08.26.16.34.59; author mendel; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.08.16.11.16.23; author mendel; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.04.27.09.01.18; author brent; state Exp;
- branches ;
- next ;
-
-
- desc
- @Top level defs
- @
-
-
- 1.7
- log
- @Commented #endif labels.
- @
- text
- @/*
- * ipServer.h --
- *
- * Global declarations of the Internet protocol server process.
- *
- * Copyright 1987 Regents of the University of California
- * All rights reserved.
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * $Header: /sprite/src/daemons/ipServer/RCS/ipServer.h,v 1.6 89/04/10 16:22:28 brent Exp Locker: rab $ SPRITE (Berkeley)
- */
-
- #ifndef _IPS_IPSERVER
- #define _IPS_IPSERVER
-
- #include "sprite.h"
- #include "status.h"
- #include "stdlib.h"
- #include "net.h"
- #ifndef KERNEL
- /*
- * We can only use the regular C library stdio in the user-level ipServer.
- * The kernel has its own printf routines.
- */
- #include <stdio.h>
- #else
- #define stderr 0
- #define stdout 0
- typedef int FILE;
- #endif
-
- /* macros and constants */
-
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
- #define MAX(a, b) ((a) > (b) ? (a) : (b))
-
- /*
- * Internal representations of the protocol numbers.
- * The protocol numbers in netInet.h are not contiguous and too spread
- * out to be useful. If you add a protocol here, be sure to update
- * the Sock_Init routine in sockOps.c.
- */
- #define RAW_PROTO_INDEX 0
- #define UDP_PROTO_INDEX 1
- #define TCP_PROTO_INDEX 2
- #define MAX_PROTO_INDEX TCP_PROTO_INDEX
-
-
- /* data structures */
-
-
- /*
- * The IPS_Packet structure describes the format of a memory buffer that
- * holds an incoming or outgoing packet. Every packet has an network header,
- * an IP header, possibly a header for a higher-level protocol, and data.
- * For an incoming packet, the headers begin at the base address of the
- * buffer. For an outgoing packet, the headers are added "bottom-up" so
- * there might be a gap of unused memory between the base and the network
- * header. The routine that allocates an outgoing packet must reserve enough
- * space to insert all the headers.
- *
- * The network header is not touched by the protocol routines. Only the
- * I/O routine is allowed to manipulate it.
- */
-
- typedef struct {
- int totalLen; /* Total length (in bytes) of the
- * buffer. */
- Address base; /* Base address returned by Mem_Alloc.
- * This is the address that is given
- * to Mem_Free to release the buffer. */
- Address dbase; /* Base address of data in buffer. */
- /*
- * The following pointers point to addresses within the buffer that
- * starts at base and ends at (base + totalLen - 1).
- */
-
- union {
- Net_EtherHdr *etherPtr; /* Ptr. to the ethernet header. */
- /*
- * Ptrs to headers for other network types go here.
- * NOTE: If you add a field here, add a corresponding field in
- * IPS_PacketNetHdr below.
- */
- } net;
-
- int ipLen; /* Length in bytes of the IP header. */
- Net_IPHeader *ipPtr; /* Ptr to the IP header. */
- int hdrLen; /* Length in bytes of the higher-level
- * protocol header. May be 0. */
- union { /* Ptr. to the HL protocol header. */
- Net_UDPHeader *udpPtr;
- Net_TCPHeader *tcpPtr;
- Net_ICMPHeader *icmpPtr;
- Address *hdrPtr;
- } hdr;
- int dataLen; /* Length in bytes of the data.
- * May be 0. */
- Address data; /* Ptr to the data. */
- } IPS_Packet;
-
- /*
- * IPS_ROOM_FOR_HEADERS defines how much space might be used by the
- * protocol headers. This is used to overallocate space so that the
- * packet data may be left in place during packet formatting.
- */
- #define IPS_ROOM_FOR_HEADERS ( (NET_TCP_MAX_HDR_SIZE + \
- NET_IP_MAX_HDR_SIZE + \
- sizeof(IPS_PacketNetHdr) + \
- sizeof(int)) & ~(sizeof(int) - 1) )
- /*
- * This type is used by routines when they need to allocate space in an
- * IPS_Packet for the network header in a network-independent way.
- * Usage: sizeof(IPS_PacketNetHdr);
- */
-
- typedef union {
- Net_EtherHdr ether; /* Ethernet header. */
- /*
- * Headers for other network types go here.
- * NOTE: If you add a field here, add a corresponding field in
- * net union in IPS_Packet above.
- */
-
- } IPS_PacketNetHdr;
-
- /* procedures and variables */
-
- extern Boolean ips_Debug;
-
- extern int IPS_GetTimeStamp();
- extern void IPS_InitPacket();
-
- #endif /* _IPS_IPSERVER */
- @
-
-
- 1.6
- log
- @Fixed IPS_ROOM_FOR_HEADERS so it is word-aligned.
- @
- text
- @d16 1
- a16 1
- * $Header: /sprite/src/daemons/ipServer/RCS/ipServer.h,v 1.5 89/03/23 09:08:24 brent Exp $ SPRITE (Berkeley)
- d45 1
- a45 1
- * The protocol numbers in netInet.h are not contiguous and too spread
- d60 1
- a60 1
- * holds an incoming or outgoing packet. Every packet has an network header,
- d62 1
- a62 1
- * For an incoming packet, the headers begin at the base address of the
- d65 1
- a65 1
- * header. The routine that allocates an outgoing packet must reserve enough
- d73 1
- a73 1
- int totalLen; /* Total length (in bytes) of the
- d86 1
- a86 1
- /*
- d88 1
- a88 1
- * NOTE: If you add a field here, add a corresponding field in
- d103 1
- a103 1
- int dataLen; /* Length in bytes of the data.
- d118 2
- a119 2
- * This type is used by routines when they need to allocate space in an
- * IPS_Packet for the network header in a network-independent way.
- d125 1
- a125 1
- /*
- d127 1
- a127 1
- * NOTE: If you add a field here, add a corresponding field in
- d140 1
- a140 1
- #endif _IPS_IPSERVER
- @
-
-
- 1.5
- log
- @Added stuff for kernel-resident ipServer.
- @
- text
- @d16 1
- a16 1
- * $Header: /sprite/src/daemons/ipServer/RCS/ipServer.h,v 1.4 89/02/21 10:06:07 brent Exp $ SPRITE (Berkeley)
- d113 4
- a116 3
- #define IPS_ROOM_FOR_HEADERS (NET_TCP_MAX_HDR_SIZE + \
- NET_IP_MAX_HDR_SIZE + \
- sizeof(IPS_PacketNetHdr))
- @
-
-
- 1.4
- log
- @Added IPS_ROOM_FOR_HEADERS. This is used to leave room for
- the protocol headers in the beginning of the request buffer.
- @
- text
- @d16 1
- a16 1
- * $Header: ipServer.h,v 1.3 88/08/26 16:34:59 mendel Exp $ SPRITE (Berkeley)
- d26 11
- @
-
-
- 1.3
- log
- @Patches for SPUR
- @
- text
- @d16 1
- a16 1
- * $Header: ipServer.h,v 1.2 88/08/16 11:16:23 mendel Exp $ SPRITE (Berkeley)
- d97 8
- @
-
-
- 1.2
- log
- @Converted to use new libc.a
- @
- text
- @d16 1
- a16 1
- * $Header: ipServer.h,v 1.1 88/04/27 09:01:18 brent Exp $ SPRITE (Berkeley)
- d67 1
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d16 1
- a16 1
- * $Header: ipServer.h,v 6.0 87/09/08 15:58:40 andrew Stable $ SPRITE (Berkeley)
- d23 2
- @
-